    <!-- form start -->
    <form role="form">
        <div class="card">

            <!--<div class="card-header">
                <h3 class="card-title">
                    <i class="fas fa-tag"></i>
                    新增角色
                </h3>
            </div>-->
            <!-- /.card-header -->
            <div class="card-body">
                <input type="hidden" id="admin_id" name="id" value="{:$data.admin_id}" placeholder="">
                <div class="form-group">
                    <label for="name">用户名称</label>
                    <input type="text" class="form-control" id="admin_name" name="admin_name" value="{:$data.admin_name}" placeholder="">
                </div>
                <div class="form-group">
                    <label for="name">密码</label>
                    <input type="password" class="form-control" id="password" name="password" value="" placeholder="">
                </div>
                <div class="form-group">
                    <label>角色</label>
                    <select name="role_id" class="form-control">
                        <option>请选择</option>
                        {volist name="role" id="vo" key="k"}
                        {if condition="$data.role.role_id==$vo.role_id"}
                        <option value="{$vo.role_id}" selected>{$vo.role_name}</option>
                        {else /}
                        <option value="{$vo.role_id}">{$vo.role_name}</option>
                        {/if}
                        {/volist}
                    </select>
                </div>
                <div class="form-group">
                    <label for="name">邮箱</label>
                    <input type="text" class="form-control" id="email" name="email" value="{:$data.email}" placeholder="">
                </div>
                <div class="form-group">
                    <label for="">角色状态</label>
                    <div style="display: flex">
                        <div class="custom-control custom-radio col-3">
                            {if condition="$data['status']==1"}
                            <input class="custom-control-input" type="radio" id="customRadio1" value="1" name="status" checked>
                            {else /}
                            <input class="custom-control-input" type="radio" id="customRadio1" value="1" name="status" >
                            {/if}
                            <label for="customRadio1" class="custom-control-label">开启</label>
                        </div>
                        <div class="custom-control custom-radio col-3">
                            {if condition="$data['status']==1"}
                            <input class="custom-control-input" type="radio" id="customRadio2" value="0" name="status">
                            {else /}
                            <input class="custom-control-input" type="radio" id="customRadio2"  value="0" name="status" checked >
                            {/if}
                            <label for="customRadio2" class="custom-control-label">禁用</label>
                        </div>
                    </div>
                </div>

            </div>
            <!-- /.card-body -->

            <div class="card-footer">
                <button type="button" id="submit" class="btn btn-primary">保存</button>
            </div>
        </div>
    </form>
    <script type="text/javascript">
        function pageJs(layero, index, data, tr) {
            $(layero).find("#submit").on('click', function () {
                var formData = new FormData($(layero).find('form')[0]);
                $.ajax({
                    cache: true,
                    type: "POST",
                    url:"{:url('admin/user/doEdit')}",
                    data:formData,
                    dataType:'json',
                    processData : false,
                    async: true,
                    contentType: false,
                    error:function(XMLHttpRequest, textStatus, errorThrown){
                        // alert(textStatus);
                    },
                    success: function( response ) {
                        var code = parseInt( response.error_code );
                        switch (code) {
                            case 1:
                                popupBox( getMsgBox( {'success': response.msg}, 'success' ), function (alert_layero, alert_index) {
                                    setTimeout(function () {
                                        layer.close( alert_index )
                                    }, 600);
                                } );
                                /*$(Document).Toasts('create', {
                                    class: 'bg-danger',
                                    title: 'Toast Title',
                                    subtitle: 'Subtitle',
                                    position: 'bottomRight',
                                    body: 'Lorem ipsum dolor sit amet, consetetur sadipscing elitr.'
                                });*/

                                setTimeout(function () {
                                    layer.close( index );
                                    location.reload();
                                }, 800);
                                break;
                            case 10000:
                                popupBox( getMsgBox( response.msg, 'danger' ) );
                                break;
                            default:
                                popupBox( getMsgBox( '操作出现问题了', 'danger' ) );
                        }
                    }
                });
            });
        }

    </script>
